import *as API from './index';

export const login=(params)=>{
	return API.POST('/api/v1/auth/manager_login',params).then(res=>res)
}

export const manager_info=(params,headers)=>{
	return API.GET('/api/v1/users/manager_info',params,headers).then(res=>res)
}

export const users=(params,headers)=>{
	return API.GET('/api/v1/admin/users',params,headers).then(res=>res)
}
export const userlists=(params,headers)=>{
	return API.GET('/api/v1/admin/users',params,headers).then(res=>res)
}

export const updateUser=(url,params,headers)=>{
	return API.PUT(`/api/v1/admin/users/${url}`,params,headers).then(res=>res)
}
export const getUser=(url,params,headers)=>{
	return API.GET(`/api/v1/admin/users/${url}`,params,headers).then(res=>res)
}
export const delUser=(url,params,headers)=>{
	return API.DELETE(`/api/v1/admin/users/${url}`,params,headers).then(res=>res)
}
export const updateUserPwd=(url,params,headers)=>{
	return API.PUT(`/api/v1/admin/users/reset_pwd/${url}`,params,headers).then(res=>res)
}
export const adduser=(params,headers)=>{
	return API.POST('/api/v1/admin/users',params,headers).then(res=>res)
}

export const getUserAddress=(url,params,headers)=>{
	return API.GET(`/api/v1/admin/addresses/${url}`,params,headers).then(res=>res)
}
